import React, { useState } from 'react';
import { Divider, Radio, Table } from 'antd';


function Tables(props) {
    const [selectedRowKeys, setSelectedRowKeys] = useState([]);
    const onSelectChange = (newSelectedRowKeys) => {
        console.log('selectedRowKeys changed: ', newSelectedRowKeys);
        setSelectedRowKeys(newSelectedRowKeys);
        props.manyDel(newSelectedRowKeys)
    };
    const rowSelection = {
        selectedRowKeys,
        onChange: onSelectChange,
    };
    const hasSelected = selectedRowKeys.length > 0;

    const pagination ={
        pageSize:5,
        pageSizeOptions:['5']
    }
    var onchange = ()=>{

    }

    return (
        <Table rowSelection={props.status == 1 ? rowSelection : undefined} columns={props.columns} dataSource={props.data} pagination={props.status == 0 ? false : pagination} onChange={onchange}></Table>
    );
}
export default Tables;